package com.dkm.biz.ou.repository.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.biz.ou.domain.ShopStat;
import com.dkm.biz.ou.repository.ShopStatRepository;
import com.dkm.biz.ou.persistence.dao.ShopStatQueryDao;
import com.dkm.biz.ou.persistence.entity.ShopStatPo;

/**
 * 对象功能:t_ou_shop_stat Repository接口的实现类
 * 开发公司:dkm.com
 * 开发人员:ZHH
 * 创建时间:2017-07-25 10:28:29
 */
@Repository
public class ShopStatRepositoryImpl extends AbstractRepository<String, ShopStatPo,ShopStat> implements ShopStatRepository{
	  
	@Resource
	private  ShopStatQueryDao shopStatQueryDao;

	public ShopStat newInstance() {
		ShopStatPo po = new ShopStatPo();
		ShopStat shopStat = SpringHelper.getBean(ShopStat.class);
		shopStat.setData(po);
		return shopStat;
	}

	public ShopStat newInstance(ShopStatPo po) {
		ShopStat shopStat = SpringHelper.getBean(ShopStat.class);
		shopStat.setData(po);
		return shopStat;
	} 
	
	@Override
	protected IQueryDao<String, ShopStatPo> getQueryDao() {
		return shopStatQueryDao;
	}

	@Override
	public ShopStatPo findByShopIdAndType(String shopId) {
		Map<String, Object> param = b().a("shopId", shopId).p();
		return shopStatQueryDao.getByKey("findByShopIdAndType", param);
	}
	
}
